home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / halcn305.zip / CHANGES.TXT next >
Text File  |  1993-08-12  |  20KB  |  456 lines

  1. Changes in Halcyon 3.05:
  2.  
  3.       22 Jul 93 - Fixed problem with detecting a read-only file.  In the
  4.                   Assign method, FileMode is set to ReadOnly if the read
  5.                   only file attribute is set in the file.  If a network
  6.                   file, SharedDenyWrite is also set.
  7.  
  8.       24 Jul 93 - Modified Find to go to the end of file if no match.  This
  9.                   makes it compatible with the dBase Find procedure.
  10.  
  11.       24 Jul 93 - Modified Find to call object^.FindNear.  Now, the file
  12.                   will be positioned at the record with the next greater
  13.                   key if no match and the search did not go to end of file.
  14.                   The programmer can call Found to see if there was a match,
  15.                   and dEOF to see if the file is positioned at the end of
  16.                   file (true), or at the next greater key (false).
  17.  
  18.       25 Jul 93 - Improved the speed of setting indexes in the Select
  19.                   method.  Replaced routine to do a sequential search for the
  20.                   index key with record number matching the current number.
  21.                   New routine Finds matching record key and then confirms the
  22.                   record number matches.  Provides significant reduction in
  23.                   time required.
  24.  
  25.       25 Jul 93 - Improved the speed of switching indexes in the IndexOrder
  26.                   method.  Replaced routine to do a sequential search for the
  27.                   index key with record number matching the current number.
  28.                   New routine Finds matching record key and then confirms the
  29.                   record number matches.  Provides significant reduction in
  30.                   time required.
  31.  
  32.       28 Jul 93 - Added the following call to allow user formula expression
  33.                   processing for indexes:
  34.  
  35.                   Procedure  SetFormulaProcess(UserRoutine1 : FormulaProc;
  36.                                                UserRoutine2: XtractFunc);
  37.  
  38.                   Assigns two user-supplied routines to process formulas to
  39.                   be built and used by index files.  This call replaces the
  40.                   default DefFormulaBuild and DefFormulaXtract with the
  41.                   programmer's own routine via a call to SetFormulaProcess.
  42.  
  43.       28 Jul 93 - Added program GS_BUILD.PAS to automatically build the
  44.                   TPUs for all units.
  45.  
  46.       02 Aug 93 - Fixed problem in the Use command that did not clear the
  47.                   Object pointer when the used file changed.  This was no
  48.                   problem except when the area was cleared (Use('')), and
  49.                   then Use'd again.  Since the object pointer in the table
  50.                   was invalid, an error occured.
  51.  
  52.       07 Aug 93 - Fixed Skip method to properly load the first record or the
  53.                   ending record in the file if the skip count resulted in a
  54.                   skip distance that caused access beyond file limits.
  55.  
  56.       07 Aug 93 - Added statement to clear IOResult before attempting to
  57.                   make an IO call.  If IOResult is non-zero when a
  58.                   command is issued, it is possible the routine will
  59.                   get that result code instead of the valid result.
  60.  
  61.  
  62.                              ADDED EXAMPLE PROGRAMS
  63.  
  64.  
  65. program TestBrow;
  66.                               DBase Browser
  67.  
  68.        TESTBROW.PAS Copyright (c)  Richard F. Griffin
  69.  
  70.        20 July 1993
  71.  
  72.        102 Molded Stone Pl
  73.        Warner Robins, GA  31088
  74.  
  75.        -------------------------------------------------------------
  76.        This program demonstrates how dBase files may be browsed using
  77.        Griffin Solutions units.
  78.  
  79.        The program opens a dBase file and proceeds to browse the file.
  80.        Pressing F1 displays a list of commands available.  The browse
  81.        methods are in unit GSXT.BRO.
  82.  
  83.        Description:
  84.  
  85.           Procedure StartBrowse(lincnt, linwidth: integer);
  86.  
  87.              Initializes browse activity.  The lincnt argument is the
  88.              number of lines that can be displayed on screen.  The
  89.              linwidth argument is the line size to be displayed on
  90.              screen.  Must be called before any other command.
  91.  
  92.           Procedure ResetBrowse;
  93.  
  94.              Resets the browse function by releasing memory.  Must be
  95.              called to close the browse activity.
  96.  
  97.           Function GetBrowseHeader(bline: word): string;
  98.  
  99.              Returns the portion of the header line starting at bline
  100.              for the maximum length that can be displayed on screen.
  101.  
  102.           Function GetBrowseLine(linnum, bline: word): string;
  103.  
  104.              Returns the portion of the data record to be displayed
  105.              starting at bline position within the string array of the
  106.              record.  The function will return a string of the length
  107.              that can be displayed on screen.  Linnum is the row to be
  108.              selected, based on the record's relative position in the
  109.              display window.  UpdateBrowse must be called initially to
  110.              select the range of records to be displayed.
  111.  
  112.           Function GetBrowseRecord(linnum: integer): longint;
  113.  
  114.              Returns the physical record number for the record at linnum.
  115.              Linnum is the row to be selected, based on the record's
  116.              relative position in the display window.  UpdateBrowse must
  117.              be called initially to select the range of records to be
  118.              displayed.
  119.  
  120.           Function GetBrowseBar(bline: word): string;
  121.  
  122.              Returns a separator line to be placed between the header and
  123.              data records.  This line is created by scanning the portion
  124.              of the header line starting at bline for the maximum length
  125.              that can be displayed on screen.  If the position in the
  126.              header contains the value in broSeparator, then the value
  127.              from broIntersect is inserted in the line, otherwise the
  128.              value in broHorizontal is inserted.
  129.  
  130.           Procedure MoveBrowseLeft(var posn: word);
  131.  
  132.              Used to compute the scroll position for a scroll left.
  133.              Decrements posn by 1.  It then tests to see if posn is less
  134.              than 1 and sets it to 1 if it is less.  This value is used
  135.              by other calls to identify the starting scroll position for
  136.              GetBrowseLine and GetBrowseHeader.
  137.  
  138.           Procedure MoveBrowseRight(var posn: word);
  139.  
  140.              Used to compute the scroll position for a scroll right.
  141.              Increments posn by 1.  It then tests to see if posn is
  142.              greater than (length of the record - max line that can
  143.              be displayed), and adjusts to that length if greater.
  144.              This prevents scrolling beyond the length of the record.
  145.              The value returned in posn is used by other calls to
  146.              identify the starting scroll position for GetBrowseLine
  147.              and GetBrowseHeader.
  148.  
  149.           Procedure RenewBrowseLine(linnum: word);
  150.  
  151.              Rereads the physical record for the record displayed at
  152.              linnum.  Linnum is the row to be selected, based on the
  153.              record's relative position in the display window.
  154.              UpdateBrowse must be called initially to select the range
  155.              of records to be displayed.  This routine needs to be called
  156.              if a record is updated during the browse activity.
  157.  
  158.           Procedure TabBrowseLeft(var posn: word);
  159.  
  160.              Used to compute the scroll position for a tab left.
  161.              Decrements posn to the start of the previous field, unless
  162.              already at field 1.  This value is used by other calls to
  163.              identify the starting scroll position for GetBrowseLine and
  164.              GetBrowseHeader.
  165.  
  166.           Procedure TabBrowseRight(var posn: word);
  167.  
  168.              Used to compute the scroll position for a tab right.
  169.              Increments posn to the start of the next field.  It then
  170.              tests to see if posn is greater than (length of the record -
  171.              max line that can be displayed), and adjusts to that length
  172.              if greater. This prevents scrolling beyond the length of
  173.              the record.  The value returned in posn is used by other
  174.              calls to identify the starting scroll position for
  175.              GetBrowseLine and GetBrowseHeader.
  176.  
  177.           Procedure UpdateBrowse(action: longint);
  178.  
  179.              Retrieves records from the database file based on the command
  180.              in action.  Valid commands are: broLnDn, broLnUp, broTop,
  181.              broBttm, broPgDn, and broPgUp.  It retrieves as many records
  182.              as is necessary to fill the number of lines specified in the
  183.              StartBrowse command.
  184.  
  185. -------------------------------------------------------------------------------}
  186.  
  187. program TestFind;
  188.                           DBase File Index Find
  189.  
  190.        TESTFIND.PAS Copyright (c)  Richard F. Griffin
  191.  
  192.        24 July 1993
  193.  
  194.        102 Molded Stone Pl
  195.        Warner Robins, GA  31088
  196.  
  197.        -------------------------------------------------------------
  198.        This program demonstrates how dBase files may use the Find call.
  199.  
  200. -------------------------------------------------------------------------------}
  201.  
  202.  
  203. program TestFrm1;
  204.                                 Formula Routine
  205.  
  206.        TESTFRM1.PAS Copyright (c)  Richard F. Griffin
  207.  
  208.        27 July 1993
  209.  
  210.        102 Molded Stone Pl
  211.        Warner Robins, GA  31088
  212.  
  213.        -------------------------------------------------------------
  214.  
  215.        The Formula routine in HALCYON only handles straight field names.
  216.        However, the power of using objects is how simple it becomes to
  217.        modify an ancestor object.  The following code, taken from demo
  218.        program GSDMO_06.PAS, shows creating a child object with a virtual
  219.        method Formula.  This method will be called anytime a formula is
  220.        needed for an index action from anywhere within the ancestor
  221.        object(s).
  222.  
  223.        In this example, the PAYMENT field is converted to a string of nine
  224.        characters with two decimal places.  The BIRTHDATE field is then
  225.        converted to a display format (YY/MM/DD) and appended to the string.
  226.        The string is then returned as the formula's result.
  227.  
  228.        The IndexOn command must contain the correct formula; for example:
  229.        "IndexOn('DEMOFRM1','STR(PAYMENT,9,2)+DTOC(BIRTHDATE)')", so
  230.        it will be stored properly in the index header for use by other
  231.        programs such as dBase, FoxPro, Clipper, etc.
  232.  
  233.  
  234.       Description:
  235.                   Added the following call to allow user formula expression
  236.                   processing for indexes:
  237.  
  238.                   Procedure  SetFormulaProcess(UserRoutine1 : FormulaProc;
  239.                                                UserRoutine2: XtractFunc);
  240.  
  241.                   Assigns two user-supplied routines to process formulas to
  242.                   be built and used by index files.  This call replaces the
  243.                   default DefFormulaBuild and DefFormulaXtract with the
  244.                   programmer's own routine via a call to SetFormulaProcess.
  245.  
  246.                   The Formula routine in HALCYON only handles straight field
  247.                   names.  However, the SetFormulaProcess allows a user-
  248.                   supplied routine to be called anytime a formula is needed
  249.                   for an index action from anywhere within the ancestor
  250.                   object(s).
  251.  
  252.                   Two routines must be provided.  UserRoutine1 is a routine
  253.                   that parses the expression and translates into paramaters
  254.                   are understood by UserRoutine2.  UserRoutine2 is called
  255.                   everytime a index key is to be extracted from a record.
  256.  
  257.                   In this example, substrings of the first five positions
  258.                   of the LASTNAME and FIRSTNAME fields are combined in a
  259.                   string that is then returned as the formula's result.
  260.  
  261.                   The IndexOn command must contain the correct formula;
  262.                   for example:
  263.  
  264.                   IndexOn('DEMOFRM2',
  265.                           'SUBSTR(LASTNAME,1,5)+SUBSTR(FIRSTNAME,1,5)');
  266.  
  267.                   so it will be stored properly in the index header for use
  268.                   by other programs such as dBase, FoxPro, Clipper, etc.
  269.  
  270.  
  271.                  ($F+)
  272.                  Function UFormula(st:string;var fmrec:GSR_FormRec): boolean;
  273.                  var FldCnt : integer;
  274.                  begin
  275.                     if (fmrec.FAlias = 'TESTFRM2') then  (Correct Index?)
  276.                     begin                                (set extract table)
  277.                        UFormula := true;
  278.                        for FldCnt := 0 to 32 do fmrec.FPosn[FldCnt] := 0;
  279.                        fmrec.FType := 'C';  (Character key)
  280.                        fmrec.FDcml := 0;
  281.                        fmrec.FSize := 10; (5 chars from LASTNAME & FIRSTNAME)
  282.                     end
  283.                     else UFormula := true;
  284.                  end;
  285.  
  286.                  Function UFormXtract(var st:string;fmrec:GSR_FormRec):boolean;
  287.                  begin
  288.                     if (fmrec.FAlias = 'TESTFRM2') then    (Correct index?)
  289.                     begin
  290.                        UFormXtract := true;
  291.                        st := SubStr(FieldGet('LASTNAME'),1,5) +
  292.                        SubStr(FieldGet('FIRSTNAME'),1,5);
  293.                     end
  294.                     else UFormXtract := false;
  295.                  end;
  296.                  ($F-)
  297.                                       .
  298.                                       .
  299.                                       .
  300.                 Select(1);
  301.                 Use('GSDMO_01');
  302.                 SetFormulaProcess(UFormula, UFormXtract);
  303.                                       .
  304.                                       .
  305.  
  306.  
  307.                  To return to the default, simply use:
  308.  
  309.                  SetFormulaProcess(DefFormulaBuild, DefFormulaXtract);
  310.  
  311.                  Note that the assigned procedure must use far calls ($F+).
  312.                  Also note that SetFormulaProcess should not be called until
  313.                  a file has been assigned to the selected file area through
  314.                  Use.  If no file has been assigned, Error 1008, Object is
  315.                  not initialized in file area, will halt the program.
  316.  
  317.                  See TESTFRM1.PAS and TESTFRM2.PAS for demonstrations of
  318.                  this function.
  319.  
  320. -------------------------------------------------------------------------------}
  321.  
  322. program TestFrm2;
  323.                                 Formula Routine
  324.  
  325.        TESTFRM2.PAS Copyright (c)  Richard F. Griffin
  326.  
  327.        27 July 1993
  328.  
  329.        102 Molded Stone Pl
  330.        Warner Robins, GA  31088
  331.  
  332.        -------------------------------------------------------------
  333.  
  334.        The Formula routine in HALCYON only handles straight field names.
  335.        However, the power of using objects is how simple it becomes to
  336.        modifiy an ancestor object.  The following code, taken from demo
  337.        program GSDMO_06.PAS, shows creating a child object with a virtual
  338.        method Formula.  This method will be called anytime a formula is
  339.        needed for an index action from anywhere within the ancestor
  340.        object(s).
  341.  
  342.        In this example, substrings of the first five positions of the
  343.        LASTNAME and FIRSTNAME fields are combined in a string that is
  344.        then returned as the formula's result.
  345.  
  346.        The IndexOn command must contain the correct formula; for example:
  347.        IndexOn('DEMOFRM2','SUBSTR(LASTNAME,1,5)+SUBSTR(FIRSTNAME,1,5)');
  348.        so it will be stored properly in the index header for use by other
  349.        programs such as dBase, FoxPro, Clipper, etc.
  350.  
  351. -------------------------------------------------------------------------------}
  352.  
  353. program TestPick;
  354.                               DBase File Lister
  355.  
  356.        TESTPICK.PAS Copyright (c)  Richard F. Griffin
  357.  
  358.        20 July 1993
  359.  
  360.        102 Molded Stone Pl
  361.        Warner Robins, GA  31088
  362.  
  363.        -------------------------------------------------------------
  364.        This program demonstrates how dBase records may be selected using
  365.        pick menus in Griffin Solutions units.
  366.  
  367.        See SHOWOFF.PAS for additional examples.
  368.  
  369.        ---  WILL NOT RUN UNDER WINDOWS ---
  370.  
  371. -------------------------------------------------------------------------------}
  372.  
  373.  
  374. program TestSch1;
  375.                               DBase Key Field Locator
  376.  
  377.        TESTSCH1.PAS Copyright (c)  Richard F. Griffin
  378.  
  379.        14 July 1993
  380.  
  381.        102 Molded Stone Pl
  382.        Warner Robins, GA  31088
  383.  
  384.        -------------------------------------------------------------
  385.        This program demonstrates how key strings may be located in dBase
  386.        files.
  387.  
  388.        If the GSDMO_01.DBF file does not exist, the program will display a
  389.        a message that the file was not found and to run GSDMO_01 to make
  390.        the file.
  391.  
  392.        Upon execution, the program sets the size of the cache file to a
  393.        maximum of 64512 bytes.  It will then ask for a LASTNAME field key to
  394.        find.  Enter any portion of the string.
  395.  
  396.        The search routine is in GSXT_SCH.PAS
  397.  
  398.        Description:
  399.  
  400.        Procedure is called as follows:
  401.  
  402.           Result := SearchDBF(s, FNum, fromtop)
  403.  
  404.        Where:
  405.               s          = The string to search for
  406.               FNum       = The record field to search
  407.               fromtop    = Boolean true to start from the top of the file,
  408.                            false to continue from the current record.
  409.               Result     = Starting position of the found string in the
  410.                            field, or zero if the string is not found.
  411.  
  412.        The file in the selected file (using GSOBShel) will be searched for
  413.        the record field that matches the string s.  Records will be read
  414.        through whatever filters are set (deleted records ignored, etc.).
  415.        When a match is found the starting location within the field is
  416.        returned and the file is positioned with the matching record as
  417.        the current record.  If no match, zero is returned and the current
  418.        record is positioned to the initial position as when the call was
  419.        made.
  420.  
  421.        NOTE THAT THIS TEST IS NOT CASE SENSITIVE!!
  422.  
  423.        See TESTSCH1.PAS and TESTSCH2.PAS for an example of how to use the
  424.        routine.
  425.  
  426. -------------------------------------------------------------------------------}
  427.  
  428.  
  429. program TestSch2;
  430.                               DBase Key Field Locator
  431.  
  432.        TESTSCH2.PAS Copyright (c)  Richard F. Griffin
  433.  
  434.        14 July 1993
  435.  
  436.        102 Molded Stone Pl
  437.        Warner Robins, GA  31088
  438.  
  439.        -------------------------------------------------------------
  440.        This program demonstrates how status may be checked while running
  441.        key string searches in dBase files.
  442.  
  443.        This example is an extension of the status reporting example that
  444.        was demonstrated in GSDMO_17.PAS.
  445.  
  446.        If the GSDMO_17.DBF file does not exist, the program will display a
  447.        a message that the file was not found and to run GSDMO_17 to make
  448.        the file.
  449.  
  450.        The program opens a dBase file and will ask for a LASTNAME field
  451.        key to search for.  Enter any portion of the string.  During the
  452.        search, the current record being searched is reported.
  453.  
  454. -------------------------------------------------------------------------------}
  455.  
  456.